<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"  href="/styles/general.css"/>
<link rel="stylesheet" type="text/css" href="/styles/main.css"/>
<link rel="stylesheet" type="text/css" href="/styles/validator.css"/>
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/formValidator.js" type="text/javascript"></script>
<script src="/js/formValidatorRegex.js" type="text/javascript"></script>
<script type="text/javascript"> 
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",onerror:function(msg){alert(msg)}});	
	//$("#password").formValidator({onshow:"请输入密码",onfocus:"请至少要输入4个字符",oncorrect:"OK",defaultvalue:""}).inputValidator({min:4,max:20,onerror:"长度不正确,请确认"});
	$("#password1").formValidator({onshow:"请输入密码",onfocus:"密码不能为空",oncorrect:"密码合法"}).inputValidator({min:1,max:20,empty:{leftempty:false,rightempty:false,emptyerror:"密码两边不能有空符号"},onerror:"密码不能为空,请确认"});
	$("#password2").formValidator({onshow:"请输入重复密码",onfocus:"两次密码必须一致哦",oncorrect:"密码一致"}).inputValidator({min:1,max:20,empty:{leftempty:false,rightempty:false,emptyerror:"重复密码两边不能有空符号"},onerror:"重复密码不能为空,请确认"}).compareValidator({desid:"password1",operateor:"=",onerror:"2次密码不一致,请确认"});
	var url = "/admin/checkpassword/";
	$("#password").formValidator({onshow:"请输入原始密码",onfocus:"原始密码至少4个字符,最多20个字符",oncorrect:"原始密码输入正确"}).inputValidator({min:4,max:20,onerror:"你输入的原始密码不正确,请确认"})
    .ajaxValidator({
    type : "get",
	url : url,
	datatype : "json",
	success : function(data){
        if( data == "1" )
		{
            return true;            
		}
        else
		{
            return false;
		}		
	},
	buttons: $("#button"),
	error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
	onerror : "原始密码不正确，请重新输入",
	onwait : "正在对原始密码进行校验，请稍候..."
});
});
</script>
<title></title>
</head>
<body>
<h1>
<span class="action-span"></span>
<span class="action-span1">修改密码</span>
<div style="clear:both"></div>
</h1>
<div class="main-div">
  <form action="/admin/password/" method="post" name="myform" id="myform" enctype="multipart/form-data">
  <table width="100%" id="table_form">
     <tr>
        <td class="label">用户名：</td>
        <td>
        <input type="hidden" id="userid" name="userid" value="{$userinfo['userid']}"></input>
        	{$userinfo['username']}
        </td>
        <td></td>
      </tr>
      <tr>
        <td class="label">原始密码：</td>
        <td>
        	{form password * password password}
        </td>
        <td><div id='passwordTip' style="width:250px"></div></td>
      </tr>     
      <tr>
        <td class="label">新密码：</td>
        <td>
        	{form password * password1 password1}
        </td>
        <td><div id="password1Tip" style="width:250px"></div></td>
      </tr>     
      <tr>
        <td class="label">重复密码：</td>
        <td>
        	{form password * password2 password2}
        </td>
        <td><div id="password2Tip" style="width:250px"></div></td>
      </tr>     
      </table>  
   <div class="button-div">
        <input type="submit" name="button" id="button" value="&nbsp;确&nbsp;定&nbsp;" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" value="&nbsp;重&nbsp;置&nbsp;" />
   </div>
  </form>
</div>
{template 'footer.html'}
</body>
</html>
